package com.imooc.sm.service.impl;

import com.imooc.sm.dao.PowerDao;
import com.imooc.sm.entity.Staff;
import com.imooc.sm.service.PowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("powerService")
public class PowerServiceImpl implements PowerService {

    @Autowired
    @Qualifier("powerDao")
    private PowerDao powerDao;

    public void edit(Staff staff) {
        powerDao.update(staff);
    }

    public Staff get(Integer id) {
        return powerDao.selectById(id);
    }

    public List<Staff> getAll() {
        return powerDao.selectAll();
    }
}
